<template>
	<view>
		<view class="top">
			<view class="">
				<view class="t1">
					结算金额
				</view>
				<view class="t2">
					<span>￥</span>{{info.amountSeparateShop}}
				</view>
			</view>
		</view>
		<view class="content">
			<view class="its">
				<view class="its_l">商品总价</view>
				<view class="price2">￥{{info.amountOrder}}</view>
			</view>
			<view class="" v-if="isexpand">
				<view class="its">
					<view class="its_l">商品种类</view>
					<view class="its_l">{{info.productCategory}}</view>
				</view>
				<view class="its">
					<view class="its_l">商品数量</view>
					<view class="its_l">{{info.productCount}}</view>
				</view>
				<view class="its">
					<view class="its_l">用户昵称</view>
					<view class="its_l">{{info.userName}}</view>
				</view>
				<view class="its " 
				style="margin: 20rpx auto;
				border-top: 1px solid #eee;
				padding-top: 20rpx;">
					<view class="its_l">订单编号</view>
					<view class="its_l flex_b">{{info.orderNumber}} <span class="btn" @click="copy">复制</span></view>
				</view>
				<view class="its">
					<view class="its_l">支付方式</view>
					<view class="its_l">{{info.orderPayType}}</view>
				</view>
				<view class="its">
					<view class="its_l">下单时间</view>
					<view class="its_l">{{info.orderCreateTime}}</view>
				</view>
				<view class="its">
					<view class="its_l">支付时间</view>
					<view class="its_l">{{info.orderTakeTime}}</view>
				</view>
			</view>
			<view class="check">
				<view class="" v-if="isexpand" @click="isexpand=!isexpand">
					收起 <uni-icons color="#D1CDCD" size="16" type="top"></uni-icons>
				</view>
				<view class="" v-else @click="isexpand=!isexpand">
					更多 <uni-icons color="#D1CDCD" size="16" type="down"></uni-icons>
				</view>
			</view>
		</view>
	    <view class="block_1">
	    	<view class="tit">
	    		<view class="t_l">
	    			商家对顾客的活动补贴
	    		</view>
				<view class="t_r">
					-￥{{info.amountCoupon}}
				</view>
	    	</view>
			<view class="cont">
				券前价￥{{info.amountOrder}}
				<p>				消费券商家承担￥{{info.couponAmountShop}}，伊可库承担￥{{info.couponAmountSystem}}</p>
			</view>
	    </view>
		<view class="block_1">
			<view class="tit">
				<view class="t_l">
					佣金&手续费
				</view>
				<view class="t_r">
					-￥{{price}}
				</view>
			</view>
			<view class="cont">
				平台抽取的佣金和订单交易手续费金额汇总
				<!-- 佣金=【商品小计-商家对顾客的活动补贴】*6.60%， 最低金额1.44元 -->
			</view>
		</view>
	</view>
</template>

<script>
	import {
		separateInfo
	} from '@/common/http.api.js';
	export default {
		data() {
			return {
				isexpand:false,
				info:{}
			};
		},
		computed:{
			price(){
				return  (this.info.amountOrder - (this.info.amountSeparateShop+this.info.amountCoupon)).toFixed(2)
			}
		},
		onLoad(option) {
			separateInfo({id:option.id}).then(res=>{
				console.log(res);
				this.info = res.data
			})
		},
		methods:{
			copy() {
				uni.setClipboardData({
					data: this.info.orderNumber,
					success() {
						uni.showToast({
							title: '复制成功',
							icon: 'success'
						})
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #FBFBFB;
	}
	.top{
		width: 750rpx;
		height: 240rpx;
		background: #FFFFFF;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		text-align: center;
		.t1{
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 32rpx;
			color: #000000;
		}
		.t2{
			font-family:'DINB';
			font-weight: bold;
			font-size: 72rpx;
			color: #000000;
			span{
				font-size: 40rpx;
			}
		}
	}
	.content {
		background: #fff;
		padding: 32rpx 20rpx;
		box-sizing: border-box;
		margin-top: 20rpx;
		.its {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin: 30rpx auto;
	
			.its_l {
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #000000;
			}
	
			.price2 {
				font-family: 'DINB';
				font-size: 32rpx;
				ccolor: #000000;
			}
	
	
			.btn {
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 20rpx;
				color: #FFFFFF;
				height: 32rpx;
				background: #29A85C;
				text-align: center;
				line-height: 32rpx;
				padding: 0rpx 10rpx;
				margin-left: 10rpx;
			}
		}
	
		.check {
			text-align: center;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #D1CDCD;
			margin: 30rpx auto 0rpx;
		}
	
	}
	.block_1{
		margin-top: 20rpx;
		width: 750rpx;
		background: #FFFFFF;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		padding: 46rpx 40rpx;
		box-sizing: border-box;
		.tit{
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #000000;
			.t_r{
				font-family: 'DINB';
				font-weight: bold;
				font-size: 32rpx;
				color: #CE7034;
			}
		}
		.cont{
			width: 670rpx;
			background: #FAF9F7;
			margin-top: 24rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 26rpx;
			color: #979797;
			line-height: 34rpx;
			padding: 24rpx 30rpx;
			box-sizing: border-box;
		}
	}
</style>
